﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Models.Models;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace System.Models
{
    public class MyDbContext:DbContext
    {
        public MyDbContext():base("conn")
        {
            Database.SetInitializer<MyDbContext>(null);
        }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.AddFromAssembly(Assembly.GetExecutingAssembly());
            modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
            modelBuilder.Conventions.Remove<ManyToManyCascadeDeleteConvention>();
        }

        public DbSet<SystemSetting> SystemSettings{ get; set; }
        public DbSet<DepartmentRole> DepartmentRoles { get; set; }
        public DbSet<Storey> Storeys { get; set; }
        public DbSet<Menus> Menuss { get; set; }
        public DbSet<Monitoring> Monitorings { get; set; }
        public DbSet<OnlinSurvey> OnlinSurveys { get; set; }
        public DbSet<MessageBoard> MessageBoards { get; set; }
        public DbSet<ActivityRelease> ActivityReleases { get; set; }
        public DbSet<ParkingLot> ParkingLots { get; set; }
        public DbSet<Material> Materials { get; set; }
        public DbSet<Publicity> Publicitys { get; set; }
        public DbSet<MaterialDetailed> MaterialDetaileds { get; set; }
        public DbSet<ParkingDeal> ParkingDeals { get; set; }
        public DbSet<ParkingSale> ParkingSales { get; set; }
        public DbSet<Household> Households { get; set; }
        public DbSet<UserGuarantee> UserGuarantees { get; set; }
        public DbSet<ActivityRegistration> ActivityRegistrations { get; set; }
        public DbSet<OnlinSurveyResult> OnlinSurveyResults { get; set; }
        public DbSet<Staff> Staffs { get; set; }
        public DbSet<MaterialResponsible> MaterialResponsibles { get; set; }
        public DbSet<Jurisdiction> Jurisdictions { get; set; }
        public DbSet<HouseholeToStorey> HouseholeToStoreys { get; set; }

        // 2022/1/17
        public DbSet<TemporaryAccessApplication> TemporaryAccessApplications { get; set; }

        // 2022/2/19
        public DbSet<VideoDeposit> VideoDeposits { get; set; }
        public DbSet<ExpenseInformation> ExpenseInformations { get; set; }
        public DbSet<SurveillanceVideo> SurveillanceVideos { get; set; }
        public DbSet<CostDelivery> CostDeliverys { get; set; }


    }
}
